package com.yxq.service;

import com.yxq.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * 
 * @ClassName: UserRepository
 * @Description: 
 * @author xiaoqun.yi yixq@doordu.com  
 * @date 2017年3月29日 下午12:45:44
 * @version V1.3
 */
public interface UserRepository extends JpaRepository<User,Long> {
    User findByName(String name);

    User findByNameAndAge(String name, Integer age);

    @Query("from User u where u.name=:name")
    User findUser(@Param("name") String name);
}
